package com.qf.service.impl;

import com.qf.entity.OrderRefund;
import com.qf.entity.OrderRefundDTO;
import com.qf.mapper.OrderRefundMapper;
import com.qf.service.OrderRefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 天--道--酬--勤
 *
 * @author LiangGaoQiang
 * @ClassName OrderRefundServiceImpl
 * @Date: 2025/4/30 15:44
 * @Description: 描述
 */
@Service
public class OrderRefundServiceImpl implements OrderRefundService {
    // 注入OrderRefundMapper
    @Autowired
    private OrderRefundMapper orderRefundMapper;

    /**
     * 查询所有订单退款
     * @param orderRefundDTO 订单退款DTO
     * @return List<OrderRefund>
     */
    @Override
    public List<OrderRefund> queryAllOrderRefund(OrderRefundDTO orderRefundDTO) {
        return orderRefundMapper.queryAllOrderRefund(orderRefundDTO);
    }

    /**
     * 根据ID查询订单退款
     * @param orderRefund 订单退款对象
     * @return OrderRefund
     */
    @Override
    public boolean addOrderRefund(OrderRefund orderRefund) {
        return orderRefundMapper.addOrderRefund(orderRefund);
    }

    /**
     * 根据ID更新订单退款
     * @param orderRefund 订单退款对象
     * @return boolean true成功 false失败
     */
    @Override
    public boolean updateOrderRefund(OrderRefund orderRefund) {
        return orderRefundMapper.updateOrderRefund(orderRefund);
    }

    /**
     * 根据ID删除订单退款
     * @param id 订单退款ID
     * @return boolean true成功 false失败
     */
    @Override
    public boolean deleteOrderRefundById(Long id) {
        return orderRefundMapper.deleteOrderRefundById(id);
    }

    /**
     * 根据ID批量删除订单退款
     * @param ids 订单退款ID集合
     * @return boolean true成功 false失败
     */
    @Override
    public boolean deleteBatchOrderRefundById(List<Long> ids) {
        return orderRefundMapper.deleteBatchOrderRefundById(ids);
    }
}
